



//
//  NCoCell.m
//  房源、商铺、写字楼详情页
//
//  Created by MB__Lee on 2018/5/24.
//  Copyright © 2018年 MB__Lee. All rights reserved.
//

#import "NCoCell.h"
#import "UIImageView+WebCache.h"


@interface NCoCell()
@property (weak, nonatomic) IBOutlet UIImageView *imgV; //图片

@property (weak, nonatomic) IBOutlet UILabel *xq_label;

@property (weak, nonatomic) IBOutlet UILabel *infoLabel;

@property (weak, nonatomic) IBOutlet UILabel *rentLabel;

@end

@implementation NCoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setNiModel:(NiRecomandModel *)niModel{
    _niModel = niModel;
    
    
    //添加图片
    [self.imgV sd_setImageWithURL:[NSURL URLWithString:niModel.image] placeholderImage:[UIImage imageNamed:@"cellPlaceHolder"]];
    
    //小区名称
    self.xq_label.text = niModel.xq_name;
    
    // 月租
    
    NSUInteger rentNum = [niModel.rent integerValue];
    NSString *rentStr = [NSString stringWithFormat:@"%zd",rentNum];
    if ([niModel.category isEqualToString:@"1003"]) {
        self.rentLabel.text = [NSString stringWithFormat:@"%@元/㎡.月",rentStr];
    }else{ // 住宅 和 商铺   元/月
        self.rentLabel.text = [NSString stringWithFormat:@"%@元/月",rentStr];
    }
    
    //面积 和  位置
    if ([niModel.category isEqualToString:@"1001"]) {
        self.infoLabel.text = [NSString stringWithFormat:@"%@㎡/%@室%@厅%@卫",niModel.d_square,niModel.d_bedroom,niModel.d_livingroom,niModel.d_washroom];
    }else{
        self.infoLabel.text = [NSString stringWithFormat:@"%@㎡|%@/%@层",niModel.d_square,niModel.d_floor,niModel.d_total_floor];
    }
    
    
}


@end
